<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]

//跨域访问的时候才会存在此字段
if (isset($_SERVER['HTTP_ORIGIN']) && $_SERVER['HTTP_ORIGIN'] != '') {
    header('Access-Control-Allow-Origin:' . $_SERVER['HTTP_ORIGIN']);
    header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");
    header('Access-Control-Allow-Methods: GET, POST, PUT,DELETE');
    header('Access-Control-Allow-Credentials: true');
}

if( $_SERVER['REQUEST_METHOD'] == 'OPTIONS'){
    exit;
}
//var_dump(222);die;
// 应用目录
define('APP_PATH', __DIR__.'/application/');
define('base_url', 'https://demo.zrs365.cn/');
// 加载框架引导文件
require './thinkphp/start.php';
